package com.shopping.dao.Impl;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.shopping.dao.IBaseDao;
import com.shopping.model.Types;

import com.shopping.model.Types;
@Repository
public interface ITypesDao {


    /**
     * 查询所有类目
     */
    @Select("select*from types")
    List<Types> selAllTypes();
    
    /**
     * 添加类目
     */
    @Insert("insert into types values(null,#{name},#{num})")
    Integer addTypes(Types type);
    
    /**
     * 修改类目
     */
    @Select("select*from types where id=#{id}")
    Types selByIdTypes(Integer id);
    
    @Update("update types set name=#{name},num=#{num} where id=#{id}")
    Integer editTypes(Types type);
    
    /**
     * 删除类目
     */
    @Delete("delete from types where id=#{id}")
    Integer delType(Integer id);
    

    /**
     * 根据id查询类目
     * @param id
     * @return
     */
	@Select("select * from types where id=#{id}")
	Types selectById(Integer id);

	
}
